package com.think.controller;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.security.access.annotation.Secured;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by Administrator on 2018/5/21 0021.
 */
@RestController
public class HomeController {

    private static final Logger logger = LoggerFactory.getLogger(HomeController.class);

    @GetMapping("/")
    public String index(){
        return "home";
    }

    @GetMapping("/login_failure")
    public String loginFailure() {
        return "login failure";
    }

    @Secured("ROLE_ADMIN")
    @GetMapping("/admin")
    public String hello(){
        return "hello admin";
    }

    @Secured("ROLE_USER")
    @GetMapping("/user")
    public String user(){
        return "hello user";
    }

}